package dataImport.model;

import dataImport.model.abstracts.AbstractEntity;


public class ConfigurationTemp extends AbstractEntity {

	private static final long serialVersionUID = 2487342543078581680L;

	private StaticConfiguration staticConfiguration;

	private String entityId;

	public ConfigurationTemp(final StaticConfiguration staticConfiguration, final String entityId) {
		super(createId(staticConfiguration.getName(), entityId));
		this.staticConfiguration = staticConfiguration;
		this.entityId = entityId;
	}

	public StaticConfiguration getStaticConfiguration() {
		return this.staticConfiguration;
	}

	public void setStaticConfiguration(StaticConfiguration staticConfiguration) {
		this.staticConfiguration = staticConfiguration;
	}

	public String getEntityId() {
		return this.entityId;
	}

	public void setEntityId(String entityId) {
		this.entityId = entityId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((this.entityId == null) ? 0 : this.entityId.hashCode());
		result = prime * result + ((this.staticConfiguration == null) ? 0 : this.staticConfiguration.hashCode());
		return result;
	}

	@Override
	public boolean equals(java.lang.Object obj) {
		if (this == obj) {
			return true;
		}
		if (!super.equals(obj)) {
			return false;
		}
		if (this.getClass() != obj.getClass()) {
			return false;
		}
		ConfigurationTemp other = (ConfigurationTemp) obj;
		if (this.entityId == null) {
			if (other.entityId != null) {
				return false;
			}
		}
		else if (!this.entityId.equals(other.entityId)) {
			return false;
		}
		if (this.staticConfiguration != other.staticConfiguration) {
			return false;
		}
		return true;
	}

}
